import request from "../utils/request.js";

//获取所有
export function getAll() {
    return request({
        url: "/content/questions/",
        method: "GET",
    });
}
//获取随机20个题目
export function getRandomQuestions() {
    return request({
        url: "/content/randomQuestions/",
        method: "GET",
    });
}

// 添加
export function addAnswer(data) {
    console.log(data);
    return request({
        url: "/content/questions-and-answers/create/",
        method: "POST",
        data,
    });
}

// 删除
export function deleteAnswer(id) {
    return request({
        url: "/content/questions-and-answers/" + id + "/delete/",
        method: "DELETE",
    });
}